<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="java.util.Collection" %>
<%
	request.setAttribute("path", request.getContextPath());
%>
<link rel="stylesheet" href="${path}/portal/css/tree/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="${path}/portal/css/tree/demo.css" type="text/css">
<script type="text/javascript" src="${path}/portal/js/tree/jquery.ztree.core-3.5.min.js"></script>
<script type="text/javascript" src="${path}/portal/js/tree/jquery.ztree.excheck-3.5.min.js"></script>
<script type="text/javascript">
var setting = {
	data: {
		key: {
			title:"t"
		},
		simpleData: {
			enable: true,
			idKey:"id",
			pIdKey:"parentId"
		}
	},
	callback: {
		onClick: onNodeClick
	}
};
function reloadTree(id){
	$.getJSON("${param.overview}",{id:id},function(data){
		if(data){
			$.fn.zTree.init($("#commonTree"), setting, data);
		}
	});
}
function reloadChildren(parentId){
	$("#nodeChildren").load("${param.children}",{parentId:parentId},
		function(){
	});
}
function onNodeClick(event, treeId, treeNode, clickFlag){
	reloadChildren(treeNode.id);
}
$(document).ready(function(){
	reloadTree(-99);
	reloadChildren(-99);
	
});
</script>
<ul id="commonTree" class="ztree" style="min-width:250px"></ul>

